package cn.wolfcode.luowowo.article.query;

import cn.wolfcoe.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Setter
@Getter
@ToString
public class TravelsQuery extends QueryObject {
    private Long destId = -1L;
    private String orderType="1" ;

    private String travelTimeType;
    private String perExpendType;
    private String dayType;
    private Boolean isPublic = true;
    private int[] state;


    public String getOrder() {
        if ("1".equals( orderType )) {
            return "t.releaseTime desc";
        } else {
            return " t.viewnum desc";
        }
    }

    public TravelCondition getTravelTime() {
        return TravelCondition.travelTimeMap.get( travelTimeType );
    }

    public TravelCondition getDay() {
        return TravelCondition.dayMap.get( dayType );
    }

    public TravelCondition getPerExpend() {
        return TravelCondition.perExpendMap.get( perExpendType );
    }

}
